<?php
namespace Modules\Home\Services;

use Common\Models\UserModel;

class UserService {
  public function create($data) {
    $userModel = new UserModel($data);

    if(!$userModel -> create()) {
      $messages = $userModel -> getMessages();
      return ['code' => -1, 'message' => $messages[0] -> getMessage()];
    }

    return ['code' => 0, 'user' => $userModel];
  }
}
